<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>


<?php    
    $dsn = 'mysql:dbname=unidu_rezervacija;host=localhost;port=3306;charset=utf8';
    try {
      $dbh = new PDO($dsn, 'root', '');
    }
    catch (PDOException $e) {
      die('Konekcija neuspješna: ' . $e->getMessage(  ));
    }
    
	
	if (true) {
    $upit_s_parametrom = 'CALL unidu_rezervacija.dohvati_rezervacije_po_tjednu(:p_in_datum)';
    $sth=$dbh->prepare($upit_s_parametrom);
    $p_in_datum = '2012-01-29';
    $sth->bindParam(':p_in_datum', $p_in_datum, PDO::PARAM_STR, 10);
    $sth->execute();
    while ($row=$sth->fetch(  )) {
      printf("%d %s %s %s %s %s<br />",$row['TRANSFER_ID'], $row['VRIJEME_POCETAK'], $row['VRIJEME_KRAJ'], $row['ODREDISTE'], $row['PUTNICI'],$row['SVRHA']);
      } 
	
	}

 ?>
</body>
</html>